Note: clicking on references from the following list will take you to the appropriate section, whilst clicking on the main headings within the manual will return the view to this list of contents.
To run DeskEdit, insert the DeskEdit disc into your disc drive, and click on the floppy drive icon. Then double-click on the DeskEdit icon in the directory viewer. This will install DeskEdit's icon on the icon bar.
If you get the error message "C Library is out of date" when you first run DeskEdit, you will need to update your current version of the C Library file CLib (see below).
To install DeskEdit onto a hard disc, simply open the target directory on your hard disc, and drag DeskEdit's icon from its directory viewer on the DeskEdit floppy disc to the required destination.
Note that Acorn's Find application has two quirks:
To update your !System application, first remove any applications which you may have running from the Desktop (since changing CLib while they are running could cause them to crash), then double-click on the !Merge application, and follow the instructions which appear in the dialogue box. Essentially you must first drag your own !System application to the Merge dialogue box, and then drag the New DeskEdit !System to it - and the job will be done for you. You will be prompted to insert floppy discs, as appropriate.
Escape-F | Return to where Ctrl (Sh) F was last issued |
Escape-Up | Return to where Ctrl-Up was last issued |
Escape-Down | Return to where Ctrl-Down was last issued |
Escape-B | Insert "break;" when in C mode |
Escape-L | Load a file into a new window |
Escape-[ | Remove "REM " in Basic or "/*" and " */" in C |
Escape-] | Ditto, then move down one line |
Escape-M | Marks from the caret to the end of a line |
Ctrl-G | Go to Basic error line (see below) |
Ctrl-Sh-G | Go to user-goto line (see below) |
Escape-G | Return to where Ctrl-(Sh)-G was last issued |
Escape-Tab | Right align C comments (see below) |
<Righthand-Shift><Left-Cursor> | Go to start of word |
<Righthand-Shift><Right-Cursor> | Go to end of word |
Escape-. | Return to where last specific finder issued |
Escape-Q,W,E,R,T,Y,U,I,O,P | Record/Playback key macros |
Escape-keypad-0 to 9 | Twenty new invisible markers |
Ctrl-Sh-K | Centre a line of text (was Escape-R) |
Escape-Escape | Unmark text |
Escape-Break | Park the mouse |
Ctrl-A | Go to matching PROC/FN definition (Basic or C) |
Escape-A | Return to where Ctrl-A called from |
Ctrl-Sh-A | Return to last PROC/FN defn called from Ctrl-A |
Escape-Return | Toggles Auto-Indent |
Ctrl-Sh-Return | Do a newline with indent |
Sh-Return | Do a newline with reduced indent |
Ctrl-E | Go to the next closing brace at the start of a line (in C only) |
Ctrl-Sh-E | As Ctrl-E but search upwards through text |
Ctrl-W | Opens a new view. |
Ctrl-Sh-W | Opens a new view with the caret at the procedure or function definition which matches the string at the caret (Basic and C) |
Basic's function Browser now uses Ctrl-F and Ctrl-Shift-F (previously Ctrl-D and Ctrl-Shift-D). This makes it consistent with the C equivalent, and frees Ctrl-D for date insertion in Basic. Ctrl- (Shift) P is no longer supported in Basic (since this was of little use).
Close window has been moved to Escape-F8 (to clear the way for the Browsers on F2).
Ctrl-Select on the "OK" button of the Hardcopy dialogue box sets back the defaults, without performing any other action.
Additionally, clicking with Adjust on a function name listed in the Function Browser (Shift-F2), opens a new window on the named function.
Templates use a standard size window for text, but small windows can be obtained by deleting Templates0 (in the !DeskEdit directory) and renaming TemplatesX to Templates0.
Once a definition has been found, two further keys may be used at any time:
Escape-A | takes you back to the line from where the function was originally called (i.e. where you originally hit Ctrl-A) |
Ctrl-Shift-A | takes you to the definition (regardless of caret position) |
A further feature of the Ctrl-A set of functions is that Ctrl-N (Next find in Quick Search) can be used to find a further matching function definition after Ctrl-A. This is particularly handy if you are working with a number of source files, and the file containing the call does not contain the function definition. Just give input focus to further files and press Ctrl-N (or even Ctrl-Shift-N to search upwards).
With DeskEdit 4 the Display width of any given file is automatically saved during an extended save (just as Format width was on DeskEdit 2). This means that if you want to use a Display width for a particular file which is different from the default, you can set this once and for all, and it will be reinstated each time your file is loaded back in (providing that you have extended saves set up).
The Display width is now controlled from the new key combination Escape-F7, which brings up a writable dialogue box showing the Display width of the current window, and allows you to set it to some other value. It should be stressed that values set in this way will not affect the default value of the Display width (i.e. as applied to new files, or to newly loaded files which do not have suitable extended-load data).
The default value can be set for the current session by using the window menu entry Display->Work area. To alter the default more permanently, you can use the undocumented 'A' option in the DeskEdit$Options.
These options are covered in the main manual. But to give an example, the following line:
set DeskEdit$Options F0 B7 A73
Note that Acorn's RISC OS library (used by DeskEdit) imposes an upper limit to the Display width of 192 characters. Text beyond this limit is simply not displayed on screen.
Escape-Shift-n | inserts a mark associated with number key n |
Escape-n | takes you to a previously remembered position |
Escape-Ctrl-n | takes you back to where you were before you pressed Escape-n. |
So, for example, hold down the Escape and Shift keys, and hit the zero on the numeric keypad. This will insert a mark at the current caret position (a beep will confirm this setting).
To return to that position at any time, just hold down Escape and hit zero on the numeric keypad.
If you want to go back to where you were before you hit Escape-0, simply press Escape and Ctrl together, and hit zero.
This is duplicated for all ten numeric keypad keys 0-9. And these marks are window specific - so you can have a set of ten for each window that is open. This is in addition to the markers on F9, F10 and Home.
Moreover, all these markers are saved when you perform an extended save, so they will all be in place when you next load your files.
A primary use for both windows will be program debugging on the desktop, since the functions and procedures supplied allow variable data and other information to be sent from a Wimp program under test to either of the two dedicated windows. But the scroller may also be used to provide a text display window for simple Wimp programs which lack their own display code.
Once the library functions have been included in a program, output can be generated by simple calls such as the following:
PROCscr_write("This is a test")
Alternatively:
PROCdebug_vv(9,"x=",x)
In C there is the added flexibility of variable arguments, so you could use:
scr_write("x is %d, y is %d, string is %s",x,y,string);
Additional procedures allow both windows to be cleared by calls from within the client program:
PROCscr_clear
and
PROCdebug_clear
scr_clear();
and
debug_clear();
Note that the Debugger and Scroller are controlled from DeskEdit's icon bar menu, and are only made active by ticking these entries. The state of these two options is saved when you save your current choices (from Choices in the same menu).
Both the Debugger and the Scroller windows have their own short menus offering the following three options:
clear
close
bring to front
For exact details of how to send messages to the two windows, you should examine the library files in the directory:
!DeskEdit.Library
PROCbox(99,99,100,200)
PROCbox
A second new feature permits you to limit the range of a Quick Search. If you press Enter (or any Shift/Ctrl combination with Enter) to initiate a Quick Search (instead of Return), then the search will end as soon as it hits marked text. So, to search for the occurrence of a variable within a particular function, move to the end of it, and mark one or more characters (e.g. with Ctrl-M). Then move to the start of the function (using Ctrl-Shift-F takes you straight there), then do your Quick Search.
The new non-wildcard search has been implemented in a special way to assist programmers in both C and Basic who want to search for particular variable names etc (though it will also be useful in Text mode). It is designed to enable you to find, for example, all references to the variable i without finding anything else which happens to contain the letter i.
Thus for example in earlier Quick Searches, if you opted to search for i, you would get every word with i in it. By turning off the wildcards at the start and end of the search string you can specify a search for i, and this will find all cases where the variable name i has been used, including:
i = 0
i=0
i,j,l
b[i]
99+(i)=1
2*i+4
$i=9
3-i-7=0
PROCi
, my_i
and ii
etc.
In Basic it is currently fooled by placing variable names immediately adjacent to Basic keywords, as in:
NEXTi
Module | Version number & date List of addresses of major blocks List of star commands |
Sprite | List of sprites contained within the file with size, mode, mask and palette details of each |
Template | List of windows contained, with no of icons in each |
PCX | Various image data, including size and number of colours |
Basic | Displays REMs in the first 10 lines plus tot no of lines in the program |
Squash | Displays original filetype and original datestamp and length |
Replay | Displays the full header information |
safesave:adfs::0.$.SAFEsave.LastSave
Alternatively, if you supply a pathname only for a safe save (i.e. a name ending in a full stop) - for example:
safesave:adfs::0.$.SAFEsave.
Again, what is saved is the file that would have been overwritten by a save. So for example, if you first save a document called my_text, it will appear only in the directory to which it was dragged. Suppose you now edit it, and then save the updated version. The SAFEsave directory will now hold the original version. A third save of the edited file will cause the second version to be retained in the SAFEsave directory, while the first version will be lost, and so on.
Using the safe saver in this way inevitably means that you will need to manually clear out the nominated directory from time to time - in particular, when you have made safe saves on the ADFS filing system of 77 files with different names - though a better option is to rename it as a file archive, and to create a new safe save directory.
The supplied Overrides file is fully commented (comments may be placed on any line beginning with a forward slash (/), and should prove helpful when editing overrides). The last line of the Overrides file should be the line:
/end
The Overrides:
1. Browser note strings - this specifies the strings that the Browser will use to indicate that a line is a remark line. For example:
browse_note_T:X**
browse_note_B:REM**
browse_note_C:/**
2. Place finder base strings - this specifies the strings that the place finder uses as its base. For example:
place_base_T:*+
place_base_B:REM
place_base_C:/*+
REM$
3. Clipboard linefeeds - if this is set, then any string that you add to the clipboard (with Ctrl-Sh-Z) will have a linefeed added to it if there is not one already. This is handy for collecting parts of lines to use elsewhere.
Syntax: clip_add_linefeeds: yes
4. C Comment String - this tells the C syntax checker that lines starting with the specified string are to be treated as comment lines (in addition to the ANSI standard "/* */").
This allows you to indicate remark lines that may fall a long distance after the remark opener "/*". For example, if you supplied <space>*<space> as follows:
C_comment_string: *
/* comments
* these are spotted *
* and these */
5. Basic Assembler Labels - If this is set, then when function searches are carried out in Basic mode (e.g. from Ctrl-F, or using the Function Browser or Ctrl A, or a Quick Search executed with Shift-Return), a line which begins with a full stop and contains the target string will also be counted as a match.
This means that you can use Ctrl-F to move from one label to the next, or that you can place the caret to the left of a label name (as in BL loop_start) for example, and Ctrl-A will take you straight to the label (with Esc-A taking you back again).
Syntax:
basic_assembler_labels: yes
6. Safe Saves - The pathname for safe saves is specified as in the following example:
safesave:SCSI::SCSI-1.$.SAFEsave.
Alternatively you can specify a single filename, as for example:
safesave:SCSI::SCSI-1.$.SAFEsave.LastSave
If there is no safe save entry in the overrides file, safe saves will not take place.
7. Printer Formfeeds and Endfeeds - the override printer_formfeeds can now be set to "yes". This simply replaces the very last line-feed on each page with a page-feed, and avoids the problem with some drivers which resulted in double page feeds (see section 2k for a slightly fuller explanation).
Additionally the override printer_endfeeds can be set to "no" to stop the last page being pushed out. The drivers normally issue a page feed as part of the end of job sequence, so this avoids a double page at the end.
Exactly what filtering takes place on input is retained, and applied in reverse during a save (except that spaces are not converted back to tabs). This is effective on all saves from F3 - including Escape-saves and Backup saves.
One of the principal uses of the filter system is for the automatic translation of files from a PC environment, but it has other uses too.
The filter is driven by a file in the Choices directory named:
Filters
The default filter file reads as follows:
filters
version:001
/ List of filetypes to be filtered on input
/ Up to 20 entries
/ A number following the colon means replace
/ tabs (0x09) with n spaces
/ tabs are not reinstated when resaving
/
/ Indicate that loaded file was filtered
verbose
/ArcScan
d1c:
/DOS
fe4:2
/end
The first two lines must be present, and should not be altered. Any number of comment lines may be included, providing they begin with a forward slash. The last line of the file should be:
/end
The keyword verbose ensures that when a file is filtered on loading, a small dynamic info box will warn you that this has occurred. If you want to turn this off, simply precede the word with a forward slash.
The data which actually specifies what filtering will take place consists of a filetype followed by a colon. The optional number following the colon is the number of spaces to use when replacing tabs. If there is no number, tabs will not be replaced. For example:
/DOS
fe4:2
To override filtering or defiltering, use the Ctrl key. Thus if you drag a file that would normally be filtered to DeskEdit's icon on the icon bar with Ctrl held down it will be loaded without filtering. If you hold down the Ctrl key while dragging a file's icon from DeskEdit's save box (generated by pressing F3) to the filer, it will not be defiltered, even if it had been filtered on input to DeskEdit.
As an example, the following indents would be automatically generated:
REPEAT
FOR A=1 TO 6
IF A=C THEN X=Z
IF A THEN
B=C
ELSE
C=D
ENDIF
NEXT
UNTIL FALSE
All reductions in indent must still be generated by the user (just by pressing Shift-Return instead of Return on its own), simply because even DeskEdit is not yet fully prescient!
The checker in DeskEdit therefore makes compromises, but can nevertheless spot many common errors, and warn you of them before you compile. A wide range of common syntax errors are checked, including missing terminating semicolons, or colons where appropriate. brackets and quotation marks are matched over multiple lines, 'if', 'for', 'do' and 'while' statements are checked for correct logical operator etc.
When any key is pressed, a "changed text" flag is set, and if it is set when any vertical movement is made to the caret (eg by cursor up or down, page up or down, F9 position finder etc.) - or when a save is instigated, a syntax check is carried out. Syntax checking can also be forced with Ctrl-Q. This does a Quick check on a line, and moves the caret downwards.
The checker now uses a different technique for checking multiple statement lines, and can cope with comments within such lines. When multi-statement lines are used, you can assist the checker by using the ANSI approved preprocessor symbol of a backslash "\" at the end of each incomplete line. This lets the checker know that it should for example hang fire until you have finished typing the next line before it complains of unmatched brackets etc.
Bracket matching (which works from Ctrl-( in both Basic and C modes) has also been improved, and is no longer fooled by chars such as "c='{'", '}', '\"' etc.
Note that if you use the keyboard shortcut ctrl-[ to open a comment, an indicator remains on screen to remind you that syntax checking is in abeyance.
When you are working near the end of the file it checks that the last character in the file is a linefeed (the compiler insists on this and faults any file where this is not the case).
An override permits a user-defined string of up to 6 chars to indicate a remark line (see Overrides above).
Lines beginning with # are not checked at all now.
If you press Ctrl-Sh-Ret on an 'if' statement without a closing semicolon, no opening brace will be generated (and no error will be signalled) - instead the next line will be indented. This is useful since otherwise the checker has no idea whether you require a brace or not.
From a DeskEdit task window you can do all the normal things, like make a system call (e.g. type Cat to catalogue your current directory). Additionally the function keys F1 to F8 are available as programmable keys. Function keys F9 to F11 behave as they normally do in DeskEdit, so you can place markers and so on without having to unlink the task window first.
You will also find that the cursor keys are active in DeskEdit task windows (they are not in Edit), so it is easy to move around and look at parts of the window that have scrolled out of view. All Ctrl keys are also active - so you can mark a line with Ctrl-Sh-M for example as you would normally in a DeskEdit window.
Additionally the normal copy editing and the clipboard are continually active. This means that if you are testing out a command - e.g. a sound command, you do not need to retype it every time - just mark it either with the mouse, or with Ctrl-M or Ctrl-Sh-M, then press Ctrl-B or Ctrl-C to copy it down to the command line. And if the line contains a carriage return - as it would if you selected it with Ctrl-Sh-M or treble-clicked with the mouse - then the line will not only be copied, it will also be automatically executed. You can also copy from any other DeskEdit window in this way.
You can even execute all the commands in an Obey file by dragging it to the task window directly from the Filer.
Run ADFS::HardDisc.$.DeskEdit -tw ADFS::HardDisc.$.Letter
You can even send your own user commands to a task window (one will be opened if there is none available). To do this, use the w command in your list of user commands in the file !DeskEdit.Data.Commands - e.g.:
Compile=\w run adfs::HardDisc.$.makefile
Root Cat=\w cat adfs::HardDisc.$
Performing a Ctrl-Sh-F3 save when in C mode works similarly, except that here, DeskEdit searches the first few lines of the source file for the name of a file to run - which could be a Make file, or better still, an Exec or Obey file which controls the Make process. The keyword task_window is used, as in the example below:
/* task_window: adfs::HardDisc.$.C.compile
*/
As an added bonus, you can also include the switch -b, to send the current window to the back of the stack. This puts it out of the way until you need it (Ctrl-Sh-Enter will bring it back again). With the switch the above example becomes:
/* task_window: -b adfs::HardDisc.$.C.compile
*/
There are ten available macro buffers for each of DeskEdit's three languages (Text, Basic and C). Each of these can be given a textual label to assist in remembering the function you have assigned to it, and each can accommodate up to 50 keypresses. All keystroke macros can be saved directly from the Save button on the Macros dialogue box.
The ten macros are associated with the letters Q-P on the second row of the keyboard. Use Esc-Sh-<key> to toggle recording on/off, and Esc-<key> to play back a macro at any time.
Thus for example if you press Escape-Sh-Q, the "Q" macro will start recording every keypress. Press the Down cursor key 3 times, then hit Escape-Sh-Q (or any other macro key since these all cancel recording), and you will have recorded a sequence of three Cursor-down movements. To use these at any time, just hit Escape-Q.
You can also control the process from the dialogue box on Ctrl-F7. Press Ctrl-F7 to display the box (or select it from the Misc edit submenu), then click on Q to select this as the current macro. You can optionally type in a memorable name of up to 11 characters (e.g. 3xCursorDwn). Click on Record to start recording, and then press Cursor down three times. Press Ctrl-F7 to stop the recording. The dialogue box will now show the length of the recording under Q. It should be 3.
Clicking on Playback will play the selected macro, while clicking on Save will save your macros to disc.
This new macro facility is very powerful, though there is just one thing that you cannot yet do with it: it will not record the keys typed into any dialogue box. If there is sufficient demand this feature may be included in a future release.
<Right-hand-Shift><Left-Cursor> | (new feature - see later) |
Ctrl-I | |
<Right-hand-Shift><Right-Cursor> | (new feature - see later) |
Ctrl-O |
Now stop recording. Now whenever you play back this macro, the word at the caret (regardless of exactly where the caret is in the word) will receive an Italics on code at the start, and an All Codes Off code at the end. It will even work if the word is immediately followed by some form of punctuation. By a similar process you can create a macro to remove such a pair of codes, though if you apply it to a word without codes, it will simply remove the first and last letter of the word.
The second example shows how to use a macro in conjunction with a Quick Search. Suppose you want to find occurrences of variables containing the sequence _paint, and add to them the sequence my_ at the start - so that xx_paint_loader and load_paint_brush would become my_xx_paint_loader and my_load_paint_brush. This is tricky to do using Find on F4, and anyway the wildcard specifiers in Find can be pretty cumbersome. So, to use Quick Search, just initiate a Quick Search using Ctrl-F, and search for _paint. This should take you to a find. Now start recording a macro, and use the following five keys:
<Right-hand-Shift><Left-Cursor> | (new feature - see later) |
m | |
y | |
_ | (underscore) |
Ctrl-N |
Then stop recording.
Now every time you play back this macro it will amend the variable at the caret, and move you on to the next find. If you want to alter this find, play the macro again, or if you want to just move on to the next find without altering the current one, press Ctrl-N.
Note the way that we have put the Ctrl-N at the end of the macro sequence, to give us the option of rejecting the replace.
OSCLI("Set DeskEdit$ERL "+STR$(ERL))
Once your program hits an error, just press Ctrl-G (for Goto Error Line), in the DeskEdit window containing the source file, and you will be taken to the error line. And this works regardless of whether your program is neatly numbered by tens or not. Note that DeskEdit's throwback window must be closed for this to work, since Ctrl-G is also used to take you to the next throwback line.
The new invisible marker on Escape-G will take you back to where you were before you issued a Ctrl-G.
DeskEdit$goto
To make it work, simply set this variable to the line number required, and then press Escape-G in any window to go to that line number. One use for this would be in Basic or C programs which handle data or text files. Your program could check through a data file, and if it came to an error, it could report the error in the normal way, but also set DeskEdit$goto to the line number in the data file where the data needs editing. All you do then is press Escape-G from the DeskEdit window holding the data file, and you will be taken straight to the error line. There are I am sure, many other uses for this trick, and if you come across any interesting ones, please write in.
The new invisible marker on Escape-G will take you back to where you were before you issued a Ctrl-Sh-G.
The override printer_formfeeds can now be set to "yes". This simply replaces the very last line-feed on each page with a page-feed. This avoids the problem with some drivers which resulted in double page feeds. The earlier solution of using artificially long page lengths is now redundant, so the driver page size should now be set to exactly match the size in DeskEdit's Page set up dialogue box.
Additionally the override printer_endfeeds can be set to "no" to stop the last page being pushed out. The drivers normally issue a page feed as part of the end of job sequence, so this avoids a double page at the end.
To set these overrides, you will need to load the file DeskEdit$Choices.Overrides into DeskEdit, and remove the leading slash from the lines:
/ printer_formfeeds: yes
/ printer_endfeeds: no
Returning with Escape: The new key combination Escape-. (Hold down Escape, and hit the full stop on the numeric keypad), will take you to where you were before you used any of the specific position finders (e.g. those activate with Esc-!, '@', '#' etc, and after Sh-Ctrl-/, '*', '#', '-', '+', and '.'.
Note that even on RISC OS 3 you can still use the specific position finders on the symbol keys on the numeric keypad. Thus while Ctrl-Sh-! no longer works, Ctrl-Sh-/ etc. does.
Calculator binary entry: Clicking with Adjust on the Shift Left calculator button (i.e. the button labelled "<<") or the Shift Right button enters a 1. This means you can use Shift Left to enter binary numbers - using Select to enter a zero, and Adjust to enter a one.
The key for centring text has now been moved from Escape-R to Ctrl-Sh-K to leave room for the new macro recording keys.
Two new key combinations have been implemented to move the caret to the start or end of a word. This is particularly useful for including in Key macros etc, and takes account of punctuation. The keys, which use the Right-hand Shift key in conjunction with the Left or Right cursor keys are:
<Right-hand-Shift><Left-Cursor> | Go to start of word |
<Right-hand-Shift><Right-Cursor> | Go to end of word |
The new key combination:
int i; /* loop variable */ |
char string[100]; /* temporary string */ |
dbox d; /* prog info dialogue box */ |
would become:
int i; | /* loop variable */ |
char string[100]; | /* temporary string */ |
dbox d; | /* prog info dialogue box */ |
after pressing Escape-Tab three times (since it moves on to the next line after alignment), and it doesn't matter where on the line the caret is positioned. It takes the length of the line from the width as set on Escape-F5.
DeskEdit 4 now fully supports the C++ convention of using a double slash to indicate that the rest of the line is to be ignored. To set up DeskEdit 4 for use with C++ remarks, Menu over Language and C from the window menu on a C source, and click on "C++". To ensure that DeskEdit starts with this option as default, perform a Choices save via the main menu.
As in DeskEdit 2, dragging a directory to the DeskEdit icon sets the current directory to the dragged item. But with DeskEdit 3 & 4 you can set the current directory to the parent of a dragged item. Dragging an object with Alt-Ctrl pressed sets the current directory to the parent of the dragged item.
This can be useful if you want to make the root directory into the CSD (not easily achieved before), or if you have a directory open on the desktop and want to make it the CSD.
The Dustbin application supplied with DeskEdit will now delete any DeskEdit datafile associated with text and other files dragged to it (i.e. datafiles created during extended saves). The datafile cannot however be retrieved from the Dustbin.
Copyright © Lee Calcraft October 1994
Published by BEEBUG Ltd, 117 Hatfield Road, St Albans, Herts AL1 4JS. Tel. 0727 840303